package com.txc.common.global.exception;

import com.txc.common.global.result.IResultCode;

import java.nio.file.AccessDeniedException;

/**
 * 没有权限异常
 *
 * @ClassName: NoPermissionException
 * @Author: TXC
 * @Date: 2022-08-16 22:17
 **/
public class LackPermissionException extends AccessDeniedException {
    protected Integer code;
    protected String message;

    public LackPermissionException(IResultCode resultCode, Throwable e) {
        super(resultCode.getMessage());
        this.code = resultCode.getCode();
        this.message = resultCode.getMessage();
    }

    public LackPermissionException(IResultCode resultCode) {
        this(resultCode, null);
    }
}
